﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections.Generic;


public partial class active_virtualsongergame_second : System.Web.UI.Page
{
    public DataTable dt = new DataTable();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string useridxs = "51015054,9157275,9158250,9157279,9158256,887766,9157282,683535,715029,9157118,9157469,9157458,9158405,52075450,714834,663506,23188336,9157461,25215792,50861203";
            string stardate = "2013-05-27";
            string enddate = "2013-05-27 23:00:00";
            dt = getdata(useridxs, stardate, enddate);
        }

    }

    public DataTable getdata(string useridxs,string stardate,string enddate)
    {
        DataTable dt = new DataTable();
        SqlParameter[] p =
                    {
                         SqlHelper.MakeInParam("@useridxs",SqlDbType.VarChar,500,useridxs),
                         SqlHelper.MakeInParam("@stardate",SqlDbType.DateTime,20,stardate), 
                        SqlHelper.MakeInParam("@enddate",SqlDbType.DateTime,20,enddate)
                    };
        try
        {
            dt = SqlHelper.ExecuteDataTable(active.Conn, CommandType.StoredProcedure, "[pr_Select_SongGift]", p);

        }
        catch (Exception ex)
        {
            string ss = ex.Message.ToString();
            dt = new DataTable();
        }
        return dt;
    }

    public int getNum(int useridx)
    {
        int res = 0;
        
        //DataRow[] merow = null;
        //merow = dt.Select("souidx=" + useridx);
        //if (merow.Length > 0)
        //{
        //    res = Convert.ToInt32(merow[0]["nums"]);
        //}
        return res;



    }
}
